#ifndef NAVIGATIONBAR_H
#define NAVIGATIONBAR_H

#include <QWidget>
#include <QVBoxLayout>
#include <QPushButton>
#include <QFont>
#include <QPainter>
#include <QStyleOption>
#include <QButtonGroup> // 添加按钮组支持

class NavigationBar : public QWidget
{
    Q_OBJECT
public:
    explicit NavigationBar(QWidget *parent = nullptr);
    QPushButton* createNavButton(const QString &text);
    void paintEvent(QPaintEvent *event) override; // 添加绘制事件声明
    void setisAdmin(bool isAdmin);
    void setupUI();

signals:
    void farmManagementSelected();
    void collaborationSelected();
    void farmInfoSelected();
private:
    QPushButton *farmManagementBtn;
    QPushButton *collaborationBtn;
    QPushButton *farmInfoBtn;
    QButtonGroup *buttonGroup; // 添加按钮组管理选中状态
    bool isAdmin;

};

#endif // NAVIGATIONBAR_H
